* Improve performance when used with a local git remote that has a
large working tree.
* Removed support for building with cryptonite, use crypton.
+ * p2phttp: Fix a hang that could occur when used with --directory,
+ and a repository in the repository got removed.
-- Joey Hess <id@joeyh.name> Fri, 29 Aug 2025 12:34:06 -0400
let lock = do
lockresv <- newEmptyTMVarIO
unlockv <- newEmptyTMVarIO
+ -- A single worker thread takes the lock, and keeps running
+- -- until unlock in order to keep the lock held.
annexworker <- async $ inAnnexWorker st $ do
lockres <- runFullProto (clientRunState conn) (clientP2PConnection conn) $ do
net $ sendMessage (LOCKCONTENT k)
checkSuccess
liftIO $ atomically $ putTMVar lockresv lockres
- liftIO $ atomically $ takeTMVar unlockv
- void $ runFullProto (clientRunState conn) (clientP2PConnection conn) $ do
- net $ sendMessage UNLOCKCONTENT
+ case lockres of
+ Right True -> do
+ liftIO $ atomically $ takeTMVar unlockv
+ void $ runFullProto (clientRunState conn) (clientP2PConnection conn) $ do
+ net $ sendMessage UNLOCKCONTENT
+ _ -> return ()
atomically (takeTMVar lockresv) >>= \case
Right True -> return (Just (annexworker, unlockv))
_ -> return Nothing
very useful, although I think I can work with the limitation [of only 1]."
[[!tag projects/INM7]]
+
+> [[done]] --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2025-09-15T15:18:15Z"
+ content="""
+Seems the bug is specific to LOCKCONTENT. When doing other operations,
+like CHECKPRESENT after the repo is deleted, the server returns
+FAILURE and continues being able to serve more requests for that repo.
+
+Ah, the problem is that serveLockContent is running a block of actions in
+a single inAnnexWorker call, which first sends on the LOCKCONTENT, then
+blocks waiting for the unlock to arrive. Which never happens, so it remains
+blocked there forever, consuming a worker thread.
+
+Fixed that, finally.
+"""]]